<template>
    <el-table
      :data="things"
      style="width: 100%"
      :row-class-name="tableRowClassName">
      <el-table-column
        prop="classId"
        label="班级"
        width="100">
      </el-table-column>
      <el-table-column
        prop="courseName"
        label="课程名称"
        width="170">
      </el-table-column>
      <el-table-column
        prop="teacherName"
        label="教师姓名"
        width="110">
      </el-table-column>
      <el-table-column
        prop="evaluationContext"
        label="评价"
        width="110">
      </el-table-column>
      <el-table-column
        label="详情"
        width="110">
        <template slot-scope="scope">
        <el-button size="mini" @click="handleEdit(scope.row)">查看详情</el-button>
      </template>
      </el-table-column>
    </el-table>
  </template>
  
  <style>
    .el-table .warning-row {
      background: oldlace;
    }
  
    .el-table .success-row {
      background: #f0f9eb;
    }
  </style>
  
  <script>
  import axios from "axios";
import { serverAddress } from "../js/config";
    export default {
      props:['things'],

      methods: {
        tableRowClassName({row, rowIndex}) {
          if (rowIndex === 1) {
            return 'warning-row';
          } else if (rowIndex === 3) {
            return 'success-row';
          }
          return '';
        }
      },
      data() {
        return {
          isEdit: false,
      ifViewDetails: false,
      fileList: null,
      commend: null,
          tableData: [{
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄',
          }, {
            date: '2016-05-04',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
          }, {
            date: '2016-05-01',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄',
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
          }]
        }
      }
    }
  </script>